package com.wlr.study.lambda;

import java.util.concurrent.Callable;

public class TestTask implements Callable<Integer> {
    public String taskName;

    public Integer result;

    public TestTask(String taskName, Integer result) {
        this.taskName = taskName;
        this.result = result;
    }

    @Override
    public Integer call() throws Exception {
        for (int i = 1; i <= 50; i++) {
            result += i;
        }
        System.out.println(taskName + "任务完成：" + result);
        return result;
    }
}
